import request from '@/utils/request'
import qs from 'qs'

export function getInfo(data) {
  return request({
    url: 'league1/info', // 假地址 自行替换
    method: 'get',
    params:data
  })
}

export function getLeagues() {
  return request({
    url: 'league1/admin/getLeagues',
    method: 'get'
  })
}

export function addLeague(data) {
  return request({
    url: 'league1/admin/addLeague',
    method: 'post',
    transformRequest: [
      function (data) {
        //在请求之前对data传参进行格式转换
        data = qs.stringify(data);
        return data;
      }
    ],
    data:data,
  })
}

export function deleteLeague(data) {
  return request({
    url: 'league1/admin/deleteLeague', // 假地址 自行替换
    method: 'delete',
    params:data
  })
}
